import {img as imgBase64 } from "./resoures_base64" 


function getBase64(url){
    return imgBase64[url] ? imgBase64[url] : url
}

export var imglist = [
    "img/0.png",
    "img/1.png",
    "img/2.png",
    "img/3.png",
    "img/4.png",
    "img/5.png",
    "img/6.png",
    "img/7.png",
    "img/8.png",
    "img/9.png",
    "img/LOGO.png",
    "img/b1.gif",
    "img/b10.gif",
    "img/b10.png",
    "img/b11.gif",
    "img/b2.gif",
    "img/b3.gif",
    "img/b4.gif",
    "img/b5.gif",
    "img/b6.gif",
    "img/b7.gif",
    "img/b8.gif",
    "img/b9.gif",
    "img/ufo-baohu.png",
    "img/baohuquan-1.png",
    "img/baohuquan-10.png",
    "img/baohuquan-11.png",
    "img/baohuquan-12.png",
    "img/baohuquan-2.png",
    "img/baohuquan-3.png",
    "img/baohuquan-4.png",
    "img/baohuquan-5.png",
    "img/baohuquan-6.png",
    "img/baohuquan-7.png",
    "img/baohuquan-8.png",
    "img/baohuquan-9.png",
    "img/bg1.jpg",
    "img/bg2.jpg",
    "img/bg3.jpg",
    "img/bg4.jpg",
    "img/bg5.jpg",
    "img/bg6.jpg",
    "img/boss (1).png",
    "img/boss (2).png",
    // "img/boss (3).png",
    // "img/boss (4).png",
    // "img/boss (5).png",
    // "img/boss (6).png",
    "img/bullet1.png",
    "img/bullet2.png",
    "img/bullet3.png",
    "img/bullet4.png",
    "img/bullet5.png",
    "img/bullet6.png",
    "img/bullet7.png",
    "img/bullet8.png",
    "img/bullet9-1.png",
    "img/bullet9-2.png",
    "img/bullet9-3.png",
    "img/bullet9-4.png",
    "img/bullet9-5.png",
    "img/bullet9-6.png",
    "img/enemy1.png",
    "img/enemy10.png",
    "img/enemy11.png",
    "img/enemy2.png",
    "img/enemy3.png",
    "img/enemy4.png",
    "img/enemy5.png",
    "img/enemy6.png",
    "img/enemy7.png",
    "img/enemy8.png",
    "img/enemy9.png",
    "img/game_pause.png",
    "img/hero.png",
    "img/hero1.png",
    "img/hero2.png",
    "img/hero3.png",
    "img/hero4.png",
    "img/hp.png",


    "img/lev_view.png",

    // "img/ownbz.png",
    "img/rankbtn.png",
    "img/restart.png",
    "img/continue_btn.png",
    "img/endgame_btn.png",
    "img/savegame_btn.png",

    "img/startGame.png",
    "img/ufo-bullet.png",
    "img/ufo-hero.png",
    "img/ufo-life.png"
];


var bgImgAll = [];
for (var i = 1; i <= 6; i++) {
    bgImgAll[i - 1] = new Image();
    bgImgAll[i - 1].src = `img/bg${i}.jpg`;
}


var e1 = [];
for (var i = 1; i <= 5; i++) {
    e1[i - 1] = new Image();
    e1[i - 1].src = "img/enemy" + i + ".png";
}
var e2 = [];
for (var i = 6; i <= 9; i++) {
    e2[i - 6] = new Image();
    e2[i - 6].src = "img/enemy" + i + ".png";
}
var e3 = [];
for (var i = 1; i <= 6; i++) {
    e3[i - 1] = new Image();
    e3[i - 1].src = getBase64("img/boss (" + i + ").png");
}
var h = [];
for (var i = 1; i <= 4; i++) {
    h[i - 1] = new Image();
    h[i - 1].src = "img/hero" + i + ".png";
}
var b = [];
for (var i = 1; i <= 8; i++) {
    b[i - 1] = new Image();
    b[i - 1].src = "img/bullet" + i + ".png";
}
var num = [];
for (var i = 0; i <= 9; i++) {
    num[i] = new Image();
    num[i].src = "img/" + i + ".png"
}
var hp = new Image();
hp.src = "img/hp.png";

var bzImage = new Image();
bzImage.src = "img/b10.png";

var heroBoomImg = [];
for (var i = 1; i <= 11; i++) {
    heroBoomImg[i] = new Image();
    heroBoomImg[i].src = "img/b" + i + ".gif"
}

var pauseImage = new Image();
pauseImage.src = "img/game_pause.png";

var ufo_life = new Image();
ufo_life.src = "img/ufo-life.png";

var ufo_b = new Image();
ufo_b.src = "img/ufo-bullet.png";

var ufo_baohu = new Image();
ufo_baohu.src = "img/ufo-baohu.png";

var ufo_hero = new Image();
ufo_hero.src = "img/ufo-hero.png";

var bhqs = [];
for (var i = 1; i <= 12; i++) {
    bhqs[i - 1] = new Image();
    bhqs[i - 1].src = "img/baohuquan-" + i + ".png";
}
var rankBtnImg = new Image();
rankBtnImg.src = "img/rankbtn.png";

var levViewImg = new Image();
levViewImg.src = "img/lev_view.png";

var continueGameBtnImg = new Image();
continueGameBtnImg.src = "img/continue_btn.png";

var saveGameBtnImg = new Image();
saveGameBtnImg.src = "img/savegame_btn.png";

var endGameBtnImg = new Image();
endGameBtnImg.src = "img/endgame_btn.png";



//添加开始图片
var startImage = new Image();
startImage.src = "img/startGame.png";
var logoImage = new Image();
logoImage.src = "img/LOGO.png";
// 添加重新开始图片
var gameagain = new Image();
gameagain.src = "img/restart.png";

export var imgMap = {

    e1,
    e2,
    e3,
    h,
    b,
    num,
    hp,
    bzImage,
    startImage,
    pauseImage,
    ufo_life,
    ufo_b,
    ufo_baohu,
    ufo_hero,
    bgImgAll,
    logoImage,
    gameagain,
    bhqs,
    rankBtnImg,

    heroBoomImg,
    continueGameBtnImg,
    saveGameBtnImg,
    endGameBtnImg,
    levViewImg
}